﻿using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Servico.Bovespa.Contabil.Service.ServiceContract;
using Sinacor.Servico.Bovespa.Contabil.Service.DataContract.Request;

namespace Sinacor.Servico.Bovespa.Contabil.Service.ServiceImplementation
{
    [SinacorServiceBehavior]
    public class IntegracaoContabil : IIntegracaoContabil
    {

        #region Campos

        private BusinessLogic.IntegracaoContabil blIntegracaoContabil;
        private
            Translator.DataContractToBusinessEntity.IntegracaoContabil dcTobeIntegracaoContabil;

        #endregion

        #region Construtor

        /// <summary>
        /// Construtor padrão
        /// </summary>
        public IntegracaoContabil()
        {
            blIntegracaoContabil = new Sinacor.Servico.Bovespa.Contabil.BusinessLogic.IntegracaoContabil();
            dcTobeIntegracaoContabil = new Sinacor.Servico.Bovespa.Contabil.Service.ServiceImplementation.Translator.DataContractToBusinessEntity.IntegracaoContabil();
        }

        #endregion

        #region IIntegracaoContabil Members

        /// <summary>
        /// Gera integração contábil
        /// </summary>
        /// <param name="request"></param>
        public void GerarIntegracaoContabil(FiltroIntegracaoContabilRequest request)
        {
            blIntegracaoContabil.GerarIntegracaoContabil(dcTobeIntegracaoContabil.ToFiltroIntegracaoContabil(request));
        }

        #endregion
    }
}
